package com.stu.exercise.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName("shopping") // 对应数据库中的表名
public class Shopping {

    @TableId(value = "id", type = IdType.AUTO) // 表示主键
    private Integer id;

    private String name;

    private Integer userId;

    private String model;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime buyTime;

    private BigDecimal price;

    private Integer amount;

    private String supplier;

    @TableField(exist = false)
    private String uname;

    private Integer status;
}
